package com.lipp.luosu.dto;

/**
 * @ClassName FileServe
 * @description: 文件服务器存储方式
 * @Author lipp
 * @Date 2024/2/4 13:14
 * @Version 1.0
 */
public enum FileServe {

    FTP("0", "ftp"),
    LOCAL("1", "local"),
    AWS_S3("2", "aws_s3");

    private String code;
    private String value;

    FileServe(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static FileServe getFileServeByCode(String code) {
        for (FileServe fileServe : FileServe.values()) {
            if (fileServe.getCode().equals(code)) {
                return fileServe;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
